package com.vehicle.ucenter.provider.mapper;

import com.vehicle.common.service.dao.CrudDao;
import com.vehicle.ucenter.api.entity.SysMenu;

import java.util.List;

/**
 * Created by yantingbin on 2017/7/10.
 */
public interface SysMenuMapper extends CrudDao<SysMenu> {
    /**
     * 根据用户查询菜单
     *
     * @param userId the user id
     * @return the list
     */
    List<SysMenu> findListByUserId(String userId);

    /**
     * 根据角色查询菜单
     *
     * @param roleId the role id
     * @return the list
     */
    List<SysMenu> findListByRoleId(String roleId);

    /**
     * 根据父ID查询菜单
     *
     * @param menu the menu
     * @return the list
     */
    List<SysMenu> findByParentIdsLike(SysMenu menu);

    /**
     * 更新父ID
     *
     * @param menu the menu
     * @return the int
     */
    int updateParentIds(SysMenu menu);
}
